/*
Copyright 2010 Bryce Alcock

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.com

 */

package com.ecocrypt.proxy.forwarder.remote;

import java.io.Serializable;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

/**
 *
 * @author Bryce.Alcock
 */
public class ForwarderDynamicStateChangedPayload implements Serializable {

    public static final String COMMAND="ForwarderDynamicStateChanged";


    int localPort;
    String remoteMachine;
    int remotePort;

    public String forwarderName;
    public AtomicInteger currentRequestId = new AtomicInteger(-1);
    public AtomicInteger errorCount = new AtomicInteger(-1);
    public AtomicInteger activeCount = new AtomicInteger(-1);
    public AtomicLong totalBytesToEngine = new AtomicLong(-1);
    public AtomicLong totalBytesFromEngine = new AtomicLong(-1);
    public AtomicLong totalBytesToClient = new AtomicLong(-1);
    public AtomicLong totalBytesFromClient = new AtomicLong(-1);

    public void printOut(){
	StringBuilder sb = new StringBuilder("ForwarderDynamicStateChangedPayload : ");
	sb.append("\n\tcurrentRequestId").append(currentRequestId);
	sb.append("\n\terrorCount").append(errorCount);
	sb.append("\n\tactiveCount").append(activeCount);
	sb.append("\n\ttotalBytesToEngine").append(totalBytesToEngine);
	sb.append("\n\ttotalBytesFromEngine").append(totalBytesFromEngine);
	sb.append("\n\ttotalBytesToClient").append(totalBytesToClient);
	sb.append("\n\ttotalBytesFromClient").append(totalBytesFromClient);
	System.out.println(sb.toString());
    }

    //  Need to add the free memory and the total memory for this forwarder.

}
